

package.path = '/usr/local/KKCJ_LUA_NEW/gcsfun/?.lua;'.. package.path
--package.cpath = '/usr/lib/?.so;'.. package.cpath
--package.path = '/Users/hongliang/Documents/LuaCode/KKCJ_LUA_NEW/gcsfun/?.lua;'.. package.path
package.cpath = '/usr/lib/?.so;'.. package.cpath

local zmq = require "lzmq"
local cjson = require "cjson" 
local utils = require "utils"
local config_utils = utils.config
local tb_config = config_utils.read('./gcs_config.conf')
local connect = arg[1]
if not connect then
    print("未输入节点信息")
    os.exit()
end
local ctx = zmq.context()
local skt,err = ctx:socket{zmq.REQ,
        linger = 0, rcvtimeo = tb_config.zmq_timeout;
        connect = connect
        }
local tb_send_data = {}
tb_send_data.cmd = "exit"
local send_data = cjson.encode(tb_send_data)
print("发送节点:",connect)
print("发送的内容信息:",send_data)
skt:send(send_data)
local res_data,err = skt:recv()
print("res_data",res_data)
